package com.skyz.base.activity;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.skyz.base.mvp.BasePresenter;
import com.skyz.base.mvp.IModel;
import com.skyz.base.mvp.IView;

public abstract class BaseMvpActivity<M extends IModel,
        V extends BaseMvpActivity<M, V, P>,
        P extends BasePresenter<M, V>>
        extends BaseActivity implements IView {

    private P mMvpPresenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        initMvp();
        super.onCreate(savedInstanceState);
    }

    private void initMvp() {
        mMvpPresenter = initMvpPresenter();
    }

    protected abstract P initMvpPresenter();

    protected P getMvpPresenter() {
        return mMvpPresenter;
    }
}
